#encoding: utf-8
from django import forms

form django.crontrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist

class RegisterForm(forms.Form):
    username = forms.CharField(widget=forms.TextInput, error_messages={'required': 'Username must be requested '})
    password = forms.CharField(widget=forms.PasswordInput, error_messages={'required': '密码不能为空'})
    password2 = forms.CharField(widget=forms.PasswordInput, required=False)
    email = forms.EmailField(error_messages = {'required': '邮箱不能为空', 'invalid': '邮箱格式不正确'})




    def clean_username(self):
